<?php


namespace app\src\redis;

use app\src\dict\dict;

/**
 *
 *
 * User: Implement hdjahs@qq.com
 * Date: 2020/12/5 21:55
 * // 阻塞状态
 */
class blockingState
{
    /* Generic fields. */
    // 阻塞时限
    public $timeout;       /* Blocking operation timeout. If UNIX current time
                             * is > timeout then the operation timed out. */

    /* REDIS_BLOCK_LIST */
    // 造成阻塞的键
    public $keys;             /* The keys we are waiting to terminate a blocking
                             * operation such as BLPOP. Otherwise NULL. */
    // 在被阻塞的键有新元素进入时，需要将这些新元素添加到哪里的目标键
    // 用于 BRPOPLPUSH 命令
    public $target;           /* The key that should receive the element,
                             * for BRPOPLPUSH. */

    /* REDIS_BLOCK_WAIT */
    // 等待 ACK 的复制节点数量
    public $numreplicas;        /* Number of replicas we are waiting for ACK. */
    // 复制偏移量
    public $reploffset;   /* Replication offset to reach. */

    public function __construct()
    {
        $this->keys = new dict();
        $this->target = new redisObject();

    }
}